package subumbo.demo.view.logo {
	import com.greensock.TweenNano;
	
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	
	import org.robotlegs.mvcs.Mediator;
	
	import subumbo.demo.controller.signal.PreviewSignal;

	public class LogoMediator extends Mediator {
		
		[Inject] public var _view:Logo;
		[Inject] public var _preview:PreviewSignal;
		
		public override function onRegister():void {
			_view.addEventListener(MouseEvent.MOUSE_DOWN, onLogo, false, 0 , true);
			_preview.add(onPreview);
		}
		
		private function onPreview():void {
			TweenNano.to(_view, 5, {alpha:0.1})
		}
		
		private function onLogo(e:MouseEvent):void {
			navigateToURL(new URLRequest("http://patrickwolleb.subumbo.com/category/work/"), "_blank");	
		}
	}
}